Multiple Boot Modes for Better Security: an Implementation of Untrusted Root
GRUB boot menu options Persistent User / Live user / Persistent Secureadmin / Persistent Superadmin / Persistent Recovery Mode and their use cases.
Introduction[edit]
The page discusses different boot modes in the Kicksecure operating system, aimed at improving security by implementing role-based boot options. It describes modes like "Persistent User" for daily activities, "SecureAdmin" for software installation with limited root privileges, and "SuperAdmin" for full system control. The goal is to isolate user activities and reduce security risks by restricting what each boot mode can access and modify. The page also explains potential opt-outs for users who prefer traditional root access.
These schemes are generic. They work for both, hosts and VMs. Both, Kicksecure and derivatives of Kicksecure such as (non-Qubes) Whonix®.
Development Goals[edit]
These goals were and are the driving direction for our boot modes implementation.
- defeat login spoofing
- Prevent Malware from Sniffing the Root Password
- Strong Linux User Account Isolation
Grub Default Boot Menu Entries[edit]
These are the default grub boot menu entries that we offer:
PERSISTENT mode USER (For daily activities.)
LIVE mode USER (For daily activities.)
PERSISTENT mode SECUREADMIN (For software installation.)
PERSISTENT mode SUPERADMIN (Be very cautious!)
Recovery PERSISTENT mode SUPERADMIN (Be very cautious!)
[edit]
We currently don’t see good use cases to include these modes as default. But we could be convinced otherwise by user feedback in the future.
LIVE mode SECUREADMIN
LIVE mode SUPERADMIN
Recovery LIVE mode SUPERADMIN
DIY methods to include these and other entries intro the GRUB boot menu
A If anyone cares about these, there could be files in /etc/grub.d/
folder that add such entries but these files could be non-executable by default. Thereby update-grub
would ignore them. To opt-in into such modes, users could just run sudo chmod +x /etc/grub.d/somenumber_name-of-boot-mode
.
B Also users who really want something special/custom would be able to add whatever they want to /etc/grub.d/
folder / grub boot menu.
C Also by using grub boot menu editing (key e
) at grub boot menu, kernel parameters can be adjusted and any combination would be possible.
Use Cases for the Different Boot Modes[edit]
These are common use cases that we tailored the available boot modes towards.
PERSISTENT mode USER (For daily activities.)
: Useful for browsing, e-mail, chat, etc. or just letting an already set up and installed server run. Even upgrading throughupgrade-nonroot
.LIVE mode USER (For daily activities.)
: Same as above but without persistence.PERSISTENT mode SECUREADMIN (For software installation.)
: users could runsudo apt install whatever-software-package
, then reboot into USER. Editing/etc/apt/sources.list.d
among many other things prohibited for better security.PERSISTENT mode SUPERADMIN (Be very cautious!)
: users could add foreign sources to/etc/apt/sources.list.d
or do anything (full freedom), then (optional but advisable) reboot to SECUREADMIN mode, install packages from third party repositories.Recovery PERSISTENT mode SUPERADMIN (Be very cautious!)
: The usual recovery mode.
opt-out to get same behavior as old Kicksecure[edit]
Users who don’t like (any, multiple or all) of the new options...
PERSISTENT mode USER (For daily activities.)
[A]LIVE mode USER (For daily activities.)
[B]PERSISTENT mode SECUREADMIN (For software installation.)
[C]
and who want "the old Kicksecure" "with unrestricted sudo" (PERSISTENT mode SUPERADMIN
) back, who don't want to see any of the new options [A], [B], [C]... These could just make these /etc/grub.d
folder / grub menu entries gone by running sudo chmod -x /etc/grub.d/somenumber_name-of-boot-mode
. (There could be a script to simplify that.)
/etc/grub.d file names[edit]
Information for working on the /etc/grub.d
file
filename purpose --------------------------------------- ----------------------------- /etc/grub.d/10_linux PERSISTENT mode USER /etc/grub.d/11_linux_live LIVE mode USER /etc/grub.d/12_linux_secureadmin PERSISTENT mode SECUREADMIN /etc/grub.d/13_linux_secureadmin_live LIVE mode SECUREADMIN /etc/grub.d/14_linux_superadmin PERSISTENT mode SUPERADMIN /etc/grub.d/15_linux_superadmin_live LIVE mode SUPERADMIN /etc/grub.d/16_linux_recovery_mode PERSISTENT mode SUPERADMIN /etc/grub.d/17_linux_recovery_mode_live Recovery LIVE mode SUPERADMIN
Should stay in lexical order below files named /etc/grub.d/20_
because that is already used by an existing script.
Note: some files will not be created in the first iteration (and not sure ever) - those listed in chapter Boot modes considered too unimportant to be added to grub default boot menu:
in my post above.
Terminology[edit]
secure admin mode
vs usersecureadmin
vssecureroot
: When booting intosecure admin mode
, the user will be logged in as usersecureadmin
. Insecureadmin mode
, when runningsudo something
the command will effectively run assecureroot
(untrusted root).super admin mode
vs usersuper admin
vssuperroot
: When booting intosuper admin mode
, the user will be logged in as usersuperadmin
. Insuper admin mode
, when runningsudo something
the command will effectively run assuperroot
(unrestricted root).untrusted root
: A command running asroot
but with restrictions applied by apparmor-profile-everything.unrestricted root
: When runningsudo something
, the behavior will be the same as on most Linux distributions such as Debian whereroot
can do everything thatroot
can usually do on such Linux distributions.
Capabilities of secureroot vs superroot[edit]
secureroot
will be untrusted root, therefore restricted but can still:
- install packages
- change most system settings
secureroot
cannot by design:
- change anything that could lead to
superroot
- change the running kernel
- replace bootloader (only if APT does this due to an upgrade)
- uninstall certain packages required to enforce the separation of
secureroot
andsuperroot
such as for example apparmor-profile-apparmor
superroot
by design will be able to do everything.
Server Support[edit]
grub boot menu isn’t easily accessible for many/most servers. How would these various boot modes be available for servers? No solution yet. See forum discussion: https://forums.whonix.org/t/multiple-boot-modes-for-better-security-persistent-user-live-user-persistent-admin-persistent-superadmin-persistent-recovery-mode/7708/50
Implementation[edit]
- https://github.com/Kicksecure/apparmor-profile-everything/tree/master/etc/grub.d
- https://github.com/Kicksecure/apparmor-profile-everything
Project Status Update[edit]
Since apparmor-profile-everything development turned out more complex than anticipated and stalled, this concept could be initially implemented without apparmor-profile-everything. Therefore only with boot modes "USER" and "SUPERADMIN". Skipping "SECUREADMIN".
Tickets[edit]
- create user admin by default and add user admin to group sudo by default
- Selective sudo Access Enabling in VMs Without qubes-core-agent-passwordless-root via qvm-service
Related[edit]
- AppArmor for everything. APT, systemd, init, all systemd units, all applications. Mandatory Access Control. Security Hardening.
- disable newly (all) installed services by default
- Verified Boot
- Untrusted Root - improve Security by Restricting Root
- forum discussion, AppArmor for Complete System - Including init, PID1, Systemd, Everything! - Full System MAC policy
Footnotes[edit]
We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 12 year success story and maybe DONATE!